package voovanHello;


import org.voovan.network.IoHandler;
import org.voovan.network.IoSession;

import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;

/**
 * 我有故事，你有酒么？
 * JKhaled created by yunqisong@foxmail.com 2017/8/31
 * FOR : 服务控制器
 */
public class VServerHandler extends VAbsHandler {

    @Override
    public Object onReceive(IoSession session, Object obj) {
        System.out.println("他说:" + obj);
        try {
            session.send(ByteBuffer.wrap(String.valueOf("他说:" + obj).getBytes("UTF-8")));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return obj;
    }
}
